home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Purity / Purity #42 (1995-01)(PackMAN)(DE)[WB].zip / Purity #42 (1995-01)(PackMAN)(DE)[WB].adf / Includes3v1 / Includes3v1.lha / Rexx / RexxIO.i < prev    next >
Text File  |  1994-12-04  |  4KB  |  134 lines

  1. { === rexx/rexxio.h ====================================================
  2.  *
  3.  * Copyright (c) 1986, 1987 by William S. Hawes.  All Rights Reserved.
  4.  *
  5.  * ======================================================================
  6.  * Header file for ARexx Input/Output related structures
  7. }
  8.  
  9. {$I "Include:Rexx/Storage.i"}
  10.  
  11. Const
  12.  
  13.     RXBUFFSZ    = 204;            { buffer length                 }
  14.  
  15. {
  16.  * The IoBuff is a resource node used to maintain the File List.  Nodes
  17.  * are allocated and linked into the list whenever a file is opened.
  18. }
  19.  
  20. Type
  21.  
  22.     IoBuff = record
  23.     iobNode        : RexxRsrc;    { structure for files/strings   }
  24.     iobRpt        : Address;    { read/write pointer            }
  25.     iobRct        : Integer;    { character count               }
  26.     iobDFH        : Integer;    { DOS filehandle                }
  27.     iobLock        : Integer;    { DOS lock                      }
  28.     iobBct        : Integer;    { buffer length                 }
  29.     iobArea        : Array [0..RXBUFFSZ-1] of Byte;
  30.                     { buffer area                   }
  31.     end;                { size: 256 bytes               }
  32.     IoBuffPtr = ^IoBuff;
  33.  
  34. Const
  35.  
  36. { Access mode definitions                                              }
  37.  
  38.     RXIO_EXIST        = -1;        { an external filehandle        }
  39.     RXIO_STRF        = 0;        { a "string file"               }
  40.     RXIO_READ        = 1;        { read-only access              }
  41.     RXIO_WRITE        = 2;        { write mode                    }
  42.     RXIO_APPEND        = 3;        { append mode (existing file)   }
  43.  
  44. {
  45.  * Offset anchors for SeekF()
  46. }
  47.  
  48.     RXIO_BEGIN        = -1;        { relative to start             }
  49.     RXIO_CURR        = 0;        { relative to current position  }
  50.     RXIO_END        = 1;        { relative to end               }
  51.  
  52. {
  53.  * A message port structure, maintained as a resource node.  The ReplyList
  54.  * holds packets that have been received but haven't been replied.
  55. }
  56.  
  57. Type
  58.  
  59.     RexxMsgPort = record
  60.     rmp_Node    : RexxRsrc;    { linkage node                  }
  61.     rmp_Port    : MsgPort;    { the message port              }
  62.     rmp_ReplyList    : List;        { messages awaiting reply       }
  63.     end;
  64.     RexxMsgPortPtr = ^RexxMsgPort;
  65.  
  66. Const
  67.  
  68. {
  69.  * DOS Device types
  70. }
  71.  
  72.     DT_DEV    = 0;            { a device                      }
  73.     DT_DIR    = 1;            { an ASSIGNed directory         }
  74.     DT_VOL    = 2;            { a volume                      }
  75.  
  76. {
  77.  * Private DOS packet types
  78. }
  79.  
  80.     ACTION_STACK    = 2002;        { stack a line                  }
  81.     ACTION_QUEUE    = 2003;        { queue a line                  }
  82.  
  83. Function  CloseF(iob: IoBuffPtr): Boolean;
  84.     External;
  85.  
  86. Function  CreateDOSPkt : Address;
  87.     External;
  88.  
  89. Procedure ClosePublicPort(nod : RexxMsgPortPtr);
  90.     External;
  91.  
  92. Procedure DeleteDOSPkt(msg : Address);
  93.     External;
  94.  
  95. Function  OpenPublicPort(list: ListPtr; name: String): RexxMsgPortPtr;
  96.     External;
  97.  
  98. Function  RexxDOSRead(filehandle : Address;
  99.             buffer : Address; len : Integer): Integer;
  100.     External;
  101.  
  102. Function  RexxDOSWrite(filehandle : Address;
  103.             buffer : Address; len : Integer): Integer;
  104.     External;
  105.  
  106. Function  ExistF(filename : String): Boolean;
  107.     External;
  108.  
  109. Function  FindDevice(name: String; tp: Integer): Address;
  110.     External;
  111.  
  112. Function  OpenF(list: ListPtr; name: String; mode: Integer; log : String) : IOBuffPtr;
  113.     External;
  114.  
  115. Function  QueueF(iob: IoBuffPtr; buf : String; len : Integer): Integer;
  116.     External;
  117.  
  118. Function  ReadF(iob: IoBuffPtr; buf : String; len : Integer): Integer;
  119.     External;
  120.  
  121. Function  ReadStr(iob: IoBuffPtr; buf : Address; len: Integer;
  122.         var ptr : Address) : Integer;
  123.     External;
  124.  
  125. Function  SeekF(iob: IoBuffPtr; off : Integer; anchor: Integer): Integer;
  126.     External;
  127.  
  128. Function  StackF(iob: IoBuffPtr; buf : String; len : Integer): Integer;
  129.     External;
  130.  
  131. Function  WriteF(iob: IoBuffPtr; buf: Address; len: Integer): Integer;
  132.     External;
  133.  
  134.